home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: CONVERTING INTEGER TO ASCII??????
- Date: 22 Mar 1996 18:41:32 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4ivocsINNfl1@keats.ugrad.cs.ubc.ca>
- References: <4i17r9$2kn@maltese.eag.unisysgsg.com> <4ic9ll$cfp@news.bridge.net> <danpop.827013499@rscernix> <4iv1a6$pl2@news.bridge.net>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4iv1a6$pl2@news.bridge.net>,
- Gary Thompson <psycho@bridge.net> wrote:
- >danpop@mail.cern.ch (Dan Pop) wrote:
- >
- >>In <4ic9ll$cfp@news.bridge.net> psycho@bridge.net (Gary Thompson) writes:
- >
- >>>buff=itoa(intvalue,buff,10); (I think...)
- >
- >>And you're wrong. There is no itoa function in the C language.
- >
- >>K&R2 contains such a function (as an example), at page 64, but it has
- >>only two arguments :-)
- >
- >Then what is this... (badly copied from my C compiler)
-
- Who gives a crap about your compiler? The function is not in the standard C
- language and that's that.
-
- >ª _
- >ª Include: <stdlib.h> _
- >ª _
- >ª Syntax: char *itoa( int value, char *string, int radix ); _
- >ª char *ltoa( long value, char *string, int radix ); _
- >ª char *ultoa( unsigned long value, char *string, int radix ); _
-
- So what does that prove? That someone can write new functions that are not part
- of the C language and pollute a standard header with their declarations?
-
- Don't you see that it's not an issue of what compiler environment you use?
- I have a function here called strdup(). That's not part of the standard.
- Neither is read(), write() or socket() or the <unistd.h> header. But at least
- these belong to some sort of standard.
-
- If you use itoa(), your program will fail to build just about everywhere.
-
- A good reference manual from a particular compiler environment will tell you,
- for each function or family of functions, what standards they adhere to. For
- example, my many page for strdup() claims that it is part of the BSD4.3 and
- SVR4 specifications; ISO9899 (the C standard) is not mentioned. The manual for
- write() tells me that it's blessed by POSIX.1, XPG4 and others.
-
- What does your manual say about the standards compliance of itoa(), ltoa() and
- ultoa()?
-
- If you can find itoa in Appendix B of the K&R2 book, I will mail you a box
- cookies.
- --
-
-